//
//  Macro.h
//  M-Saler
//
//  Created by Teresa on 2020/5/21.
//  Copyright © 2020 Teresa. All rights reserved.
//

#ifndef Macro_h
#define Macro_h


#define MH_Red_Color [UIColor colorWithHexStr:@"#F44A4A"]
#define MH_Green_Color [UIColor colorWithHexStr:@"#07BD90"]
#define MH_Gray_Color [UIColor colorWithHexStr:@"#AAA9A9"]

//单例化一个类
#define SINGLETON_FOR_HEADER(className) \
\
+ (className *)shared##className;

#define SINGLETON_FOR_CLASS(className) \
\
+ (className *)shared##className { \
static className *shared##className = nil; \
static dispatch_once_t onceToken; \
dispatch_once(&onceToken, ^{ \
shared##className = [[self alloc] init]; \
}); \
return shared##className; \
}

#ifdef DEBUG
#define DLog(fmt, ...) NSLog((@"[%s Line %d]" fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define DLog(...)
#endif

#define CopyStringProperty  @property (copy, nonatomic) NSString *
#define StrongNumberProperty @property (strong, nonatomic) NSNumber *
#define AssignProperty @property (assign, nonatomic)
#define StrongProperty @property (strong, nonatomic)

#define WEAKSELF __weak typeof(self) weakSelf = self;
#define BLOCKSELF __block typeof(self) blockSelf = self;

#endif /* Macro_h */
